package de.jmda.gen.java.impl;

import static org.junit.Assert.assertTrue;

import org.apache.log4j.Logger;
import org.junit.Test;

import de.jmda.gen.Generator;
import de.jmda.gen.GeneratorException;

public class JUT_DefaultInitialisationGenerator
{
	private final static Logger LOGGER =
      Logger.getLogger(JUT_DefaultInitialisationGenerator.class);

	@Test
	public void testDefaultInitialisationGenerator() throws GeneratorException
	{
		Generator generator = new DefaultInitialisationGenerator();

		StringBuffer generated = generator.generate();

		LOGGER.debug("generated [" + generated + "]");

		assertTrue(
				"unexpected initialisation [" + generated + "]",
				"".contentEquals(generated));
	}

	@Test
	public void testDefaultInitialisationGeneratorString()
			throws GeneratorException
	{
		String input = "= value";

		Generator generator = new DefaultInitialisationGenerator(input);

		StringBuffer generated = generator.generate();

		LOGGER.debug("generated [" + generated + "]");

		assertTrue(
				"unexpected initialisation [" + generated + "]",
				input.contentEquals(generated));
	}
}